package com.wuseguang.springcloud.dao.repository;

import com.wuseguang.springcloud.entity.OiCountdown;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface OiCountdownRepository extends JpaRepository<OiCountdown,Integer> {

    @Query(value = "select  * from oi_countdown where class_id = ?1 order by topping desc ,id desc",nativeQuery = true)
    List<OiCountdown> findByClassId(Integer classId);

    OiCountdown findByClassIdAndTopping(Integer classId, int topping);



}
